﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Share;
using Newtonsoft.Json;
namespace WebApplicationNet4
{
    /// <summary>
    /// ApiService 的摘要说明
    /// </summary>
    public class ApiService : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            var products = ProductService.GetList();
            string output = JsonConvert.SerializeObject(products);
            context.Response.ContentType = "text/json";
            context.Response.Write(output);            
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}